package com.xmh.demo.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.xmh.demo.service.AuthorService;
import com.xmh.demo.vo.AuthorVo;
import com.xmh.util.RedisUtils;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@RestController
public class AuthorController {

	@Autowired
	private AuthorService authorService;

	@ApiOperation(value = "创建用户", notes = "根据User对象创建用户")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "id", value = "平台名称", required = true, dataType = "id", paramType = "query"),
			@ApiImplicitParam(name = "name", value = "管理员密码", required = false, dataType = "String", paramType = "query") })
	@GetMapping("/getLibrarian")
	public List<AuthorVo> getALibrarianInfo(int id) {
		log.info("收到了请求！");

		RedisUtils.set("test", "testvalue");

		System.out.println(RedisUtils.get("test"));

		return authorService.selectList();
	}

}
